pipeline {
    agent {
        kubernetes {
            defaultContainer 'maven'
            yamlFile 'podTemplates/maven-3.8.3-openjdk-8.yaml'
        }
    }
    stages {
        stage('Code Clone') {
            steps {
                echo "Clone Stage"
                git branch: 'docker', credentialsId: '3a5b6f3c-402f-4bab-a107-3c4e690c607f', url: 'http://192.168.110.35/root/GeneLab.git'
                container('git'){
                    script {
                        build_tag = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
                    }
                }
                echo "${build_tag}"
            }
        }
        stage('Run maven') {
            steps {
                sh 'mvn clean package'
            }

        }
    }
}